<?php 
$chart=$this->Loyalty->make_chart($question);
$answer = Answer::get_answers_by_questions($question["Question"]['id']);
?>
<div class="question-title"><?=$question["Question"]['title']?></div>
<div class="question-result">
    <img src="<?php echo $chart['url']?>" alt="" align="left"/>
    <div class="result">
        <ul>
            <?php foreach($chart['data'] as $data){ ?>
            <li>
                <span class="title"><?=$data['option']?> <?php $id=isset($data['id'])?$data['id']:"" ;echo (in_array($id, $answer))?$this->Html->image('right.png',array('width'=>24)):""; ?> </span>
                <span class="count"><?=$data['count']?></span>
                <span class="percent"><?=$data['percent']?> % </span>
            </li>
            <?php } ?>
        </ul>
    </div>
</div>